#ifndef WIFI_MANAGER_H
#define WIFI_MANAGER_H

#include "esp_err.h"
#include "esp_wifi.h"
#include "DeviceDefine.h"

typedef struct WifiManager WifiManager;

// ---------------- 回调类型 ----------------
//---wifi--连接
typedef void (*wifi_event_callback_t)(WifiManager *manager, esp_event_base_t event_base, int32_t event_id, NetConnectType netConnectType);
//--- 提示性的
typedef void (*tip_callback_t)(WifiManager *manager, const char *status);

// 网络连接回调
void WifiManager_set_event_callback(WifiManager *manager, wifi_event_callback_t cb);
void WifiManager_set_tip_callback(WifiManager *manager, tip_callback_t cb);

// Wi-Fi 管理器初始化
WifiManager *wifi_manager_init(wifi_event_callback_t wifi_event_cb, tip_callback_t tip_callback_cb);
WifiManager *wifi_manager_get_handle(void);

// 先连上服务端的热点，等待服务端返回wifi信息后，再配置并连接 WiFi 子设备的wifi每次都必须从主设备获取
void connectWifiOrAp(WifiManager *manager, WiFiConfig *wifiConfig);
#endif // WIFI_MANAGER_H
